﻿package mortal.game.view.ranking.util
{
    import Message.Public.*;
    import com.gengine.utils.*;
    import extend.language.*;
    import fl.data.*;
    import mortal.game.resource.*;

    public class RankingUtil extends Object
    {
        private static var _categoryData:Array;
        private static var _posDic:Object = {1:[64 + 13, 164, 240, 311], 2:[64 + 13, 164, 240, 323], 3:[64, 162, 234 + 7, 311], 4:[43, 157, 233, 319], 5:[43, 157, 233, 319], 6:[43, 157, 233, 319], 7:[67, 146 + 2, 213, 317 - 4], 9:[40, 156, 131, 229, 308], 11:[39, 155 - 2, 225 + 14, 316 - 2], 13:[40, 131, 229, 308], 15:[60, 165, 232 + 15, 320 - 10 + 3], 16:[58, 165 - 3, 232 + 15, 303 + 2], 17:[40, 131, 229, 308], 18:[40, 131, 229, 308], 19:[40, 131, 229, 308], 20:[40, 131, 229, 308], 21:[40, 131, 229, 308], 22:[40, 131, 229, 308], 0:[63, 179, 234 + 10, 321 - 12], 1:[70 + 17, 149 + 15, 234 + 15, 321 - 10], 1:[70 + 17, 149 + 15, 234 + 15, 321 - 10]};

        public function RankingUtil()
        {
            return;
        }// end function

        public static function getComboBoxData(param1:int) : DataProvider
        {
            var _loc_2:* = new DataProvider();
            var _loc_3:* = new Array();
            if (param1 == 0)
            {
                _loc_3 = [{label:Language.getString(41323), type:0, career:-1}, {label:GameDefConfig.instance.getCarrer(ECareer._ECareerWarrior), type:1, career:ECareer._ECareerWarrior}, {label:GameDefConfig.instance.getCarrer(ECareer._ECareerArcher), type:2, career:ECareer._ECareerArcher}, {label:GameDefConfig.instance.getCarrer(ECareer._ECareerMage), type:3, career:ECareer._ECareerMage}];
            }
            if (param1 == 1)
            {
                _loc_3 = [{label:Language.getString(41324), type:0, camp:-1}, {label:GameDefConfig.instance.getECamp(ECamp._ECampA).text, type:1, camp:ECamp._ECampA}, {label:GameDefConfig.instance.getECamp(ECamp._ECampB).text, type:2, camp:ECamp._ECampB}, {label:GameDefConfig.instance.getECamp(ECamp._ECampC).text, type:3, camp:ECamp._ECampC}];
            }
            if (param1 == 2)
            {
                _loc_3 = [{label:Language.getString(41325), type:0, sex:-1}, {label:GameDefConfig.instance.getSex(ESex._ESexMan).text, type:1, sex:ESex._ESexMan}, {label:GameDefConfig.instance.getSex(ESex._ESexWoman).text, type:2, sex:ESex._ESexWoman}];
            }
            _loc_2.addItems(_loc_3);
            return _loc_2;
        }// end function

        public static function getCategoryData() : Array
        {
            if (_categoryData)
            {
                return _categoryData;
            }
            var _loc_1:Array = [];
            var _loc_2:* = new HashMap();
            _loc_2.push(Language.getString(41326), EToplistType._EToplistTypePlayerCombat);
            _loc_2.push(Language.getString(41327), EToplistType._EToplistTypePlayerLevel);
            _loc_2.push(Language.getString(41328), EToplistType._EToplistTypePlayerSpriteCombat);
            _loc_1.push(_loc_2);
            var _loc_3:* = new HashMap();
            _loc_3.push(Language.getString(41329), EToplistType._EToplistTypeEquipWeapon);
            _loc_3.push(Language.getString(41330), EToplistType._EToplistTypeEquipArmor);
            _loc_3.push(Language.getString(41331), EToplistType._EToplistTypeEquipJewelry);
            _loc_1.push(_loc_3);
            var _loc_4:* = new HashMap();
            _loc_4.push(Language.getString(41326), EToplistType._EToplistTypePetCombat);
            _loc_4.push(Language.getString(41332), EToplistType._EToplistTypePetGrowth);
            _loc_1.push(_loc_4);
            var _loc_5:* = new HashMap();
            _loc_5.push(Language.getString(41326), EToplistType._EToplistTypeMountCombat);
            _loc_5.push(Language.getString(41332), EToplistType._EToplistTypeMountRank);
            _loc_1.push(_loc_5);
            var _loc_6:* = new HashMap();
            _loc_6.push(Language.getString(41326), EToplistType._EToplistTypeGuildCombat);
            _loc_6.push(Language.getString(41327), EToplistType._EToplistTypeGuildLevel);
            _loc_1.push(_loc_6);
            var _loc_7:* = new HashMap();
            _loc_7.push(Language.getString(41333), EToplistType._EToplistTypeFashion);
            _loc_7.push(Language.getString(41334), EToplistType._EToplistTypeWing);
            _loc_7.push(Language.getString(41335), EToplistType._EToplistTypeWeapon);
            _loc_1.push(_loc_7);
            var _loc_8:* = new HashMap();
            _loc_8.push(Language.getString(41336), EToplistType._EToplistTypeCopyDefence20);
            _loc_8.push(Language.getString(41337), EToplistType._EToplistTypeCopyTower);
            _loc_8.push(Language.getString(41338), EToplistType._EToplistTypeCopyChallenge);
            _loc_1.push(_loc_8);
            _categoryData = _loc_1;
            return _categoryData;
        }// end function

        public static function get otherRankData() : DataProvider
        {
            var _loc_3:String = null;
            var _loc_4:Object = null;
            var _loc_1:* = new HashMap();
            _loc_1.push(Language.getString(41339), EToplistType._EToplistTypeFightSoul);
            _loc_1.push(Language.getString(41340), EToplistType._EToplistTypeFightMethod);
            _loc_1.push(Language.getString(41341), EToplistType._EToplistTypeFightDragonSoul);
            var _loc_2:* = new DataProvider();
            for each (_loc_3 in _loc_1.keys)
            {
                
                _loc_4 = {};
                _loc_4["label"] = _loc_3;
                _loc_4["type"] = _loc_1.getValue(_loc_3);
                _loc_2.addItem(_loc_4);
            }
            return _loc_2;
        }// end function

        public static function getCategoryHeadData() : Array
        {
            var _loc_1:* = Language.getArray(40402);
            return _loc_1;
        }// end function

        public static function getCategoryContentData(param1:int) : DataProvider
        {
            var _loc_4:HashMap = null;
            var _loc_5:String = null;
            var _loc_6:Object = null;
            var _loc_2:* = getCategoryData();
            var _loc_3:* = new DataProvider();
            if (param1 < _loc_2.length)
            {
                _loc_4 = _loc_2[param1];
                for each (_loc_5 in _loc_4.keys)
                {
                    
                    _loc_6 = {};
                    _loc_6["label"] = _loc_5;
                    _loc_6["type"] = _loc_4.getValue(_loc_5);
                    _loc_3.addItem(_loc_6);
                }
            }
            return _loc_3;
        }// end function

        public static function getPosInfoByRankType(param1:int) : Array
        {
            return _posDic[param1] as Array;
        }// end function

        public static function getChallengeCopyName(param1:int) : String
        {
            var _loc_5:String = null;
            var _loc_2:* = param1 - 1;
            var _loc_3:* = int(_loc_2 / 8) + 1;
            var _loc_4:* = int(_loc_2 % 8) + 1;
            switch(_loc_3)
            {
                case 1:
                {
                    _loc_5 = Language.getString(41342);
                    break;
                }
                case 2:
                {
                    _loc_5 = Language.getString(41343);
                    break;
                }
                case 3:
                {
                    _loc_5 = Language.getString(41344);
                    break;
                }
                default:
                {
                    break;
                }
            }
            return _loc_5 + _loc_4;
        }// end function

    }
}
